	//////////////////////////////////////
	//                                  //
	//            media.js              // 
	//                                  //
	//////////////////////////////////////
	
	function playAudio()
	{
		stopAllClips();
		if (atIntro)
		{
			G2_play("AUDIO_CLIP");
		}
		else
		{
			if (parent.Content.audioReference != null)
			{
				parent.Content.audioReference.play();
			}
			else
			{
				parent.Content.G2_play("AUDIO_CLIP", parent.Content.document);
			}
		}
	}

	function playVideo()
	{
		stopAllClips();
		parent.Content.G2_play("VIDEO_CLIP", parent.Content.document);
	}
	
	// This function writes to an invisible frame
	// in the window in order to play a sound.
	function playSound(mySound)
	{
		if ( audioPage || videoPage || atIntro) 
		{
			return;	
		}

		soundFrame = "<HTML><HEAD></HEAD><BODY>";
		if (navigator.appName == 'Netscape')
		{
			soundFrame = soundFrame + "<EMBED SRC = " + mySound + " AUTOSTART = TRUE HIDDEN = TRUE>";
		}
		else
			if (navigator.appName == 'Microsoft Internet Explorer')
			{
				soundFrame = soundFrame + "<BGSOUND SRC = " + mySound + ">";
			}
		soundFrame = soundFrame + "</BODY></HTML>";
		parent.hidden.document.write(soundFrame);
		parent.hidden.document.close();
		
		pause();
	}


	function pause()
	{
		var target;
		var now = new Date();
		target = now.getTime() + 1000;

		while ( true )
		{
			now = new Date();
			if ( now.getTime() > target )
			{
				return;
			}
		}
	}

function stopAllClips()
{
	FP_stopAllClips();
	// If realplayer.js is loaded in the Content window
	if (parent.Content.FP_ClipHash != null)
	{
		parent.Content.FP_stopAllClips();
	}
}
